package com.ie.api.center.manager.feign;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ie.api.center.manager.hystrix.TenantClientHystrix;
import com.xj.common.bean.R;
import com.xj.common.bean.constant.Common;
import com.xj.common.model.Point;
import com.xj.common.model.Tenant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
import java.util.Set;


//定义一个feign接口，通过@FeignClient("服务名")，来指定调用哪个服务
@FeignClient(value = Common.Service.IE_MANAGER_SERVICE_NAME,fallback= TenantClientHystrix.class)
public interface PointClient {
	


	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_ADD, method = RequestMethod.POST)
	R<Point> add(@RequestBody JSONObject jsonParam);

	/**
	 * 根据 ID 删除 Point
	 *
	 * @return Boolean
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_DELETE, method = RequestMethod.POST)
	R<Boolean> delete(@RequestBody JSONObject jsonParam);

	/**
	 * 修改 Point
	 *
	 * @return Point
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_UPDATE, method = RequestMethod.POST)
	R<Point> update(@RequestBody JSONObject jsonParam);

	/**
	 * 根据 ID 查询 Point
	 *
	 * @return Point
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_SELECTBYID, method = RequestMethod.POST)
	R<Point> selectById(@RequestBody JSONObject jsonParam);

	/**
	 * 根据 设备 ID 查询 Point
	 *
	 * @return Point Array
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_SELECTBYDEVICEID, method = RequestMethod.POST)
	R<List<Point>> selectByDeviceId(@RequestBody JSONObject jsonParam);

	/**
	 * 根据 模板 ID 查询 Point
	 *
	 * @return Point Array
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_SELECTBYPROFILEID, method = RequestMethod.POST)
	R<List<Point>> selectByProfileId(@RequestBody JSONObject jsonParam);

	/**
	 * 分页查询 Point
	 *
	 * @return Page<Point>
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_LIST, method = RequestMethod.POST)
	R<Page<Point>> list(@RequestBody JSONObject jsonParam);

	/**
	 * 查询 位号单位
	 *
	 * @return Map<Long, String>
	 */
	@RequestMapping(value = Common.Service.IE_MANAGER_POINT+Common.Service.IE_MANAGER_POINT_UNIT, method = RequestMethod.POST)
	R<Map<Long, String>> unit(@RequestBody JSONObject jsonParam);
}






